Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manually add SIP Contact header for calls when using Sofia >= 1.13 (fixes #2439, replaces #2597) #2708

Merged
merged 2 commits into from
Jul 1, 2021

Conversation

lminiero
Copy link
Member

Apparently, newer versions of Sofia SIP as maintained by Freeswitch (>= 1.13) don't add a Contact header anymore for calls that are not associated with a previous registration: this is explained in #2439. A first patch was contributed in #2597, which IMHO was a bit too complex. This PR tries to address it in a "simpler" way.

First of all, we check the Sofia SIP version at startup: if it's 1.12.x or older, we do nothing at all (as the Contact header is always there for me). Otherwise, rather than invoking nua_get_params at every call as #2597 did, we only do it once when creating the stack. Then, we conditionally add the Contact header only for guest calls, and not all of them as the original PR did.

Not sure if we should do the same for other requests as well (e.g., INFO, MESSAGE, etc.), or if my assumption that only guest users are impacted is correct. I don't have 1.13.x installed so I can't test myself: if you care about this, please test in different conditions (including, if possible, helper sessions) and let us know if this addresses the issue.

@flaviogrossi
Copy link
Contributor

i can confirm this fixes the issue for us, tested compiling with sofia 1.13 from freeswitch

Thanks for looking into this, i can confirm that including this patch the contact header is correctly added in the INVITE and other requests, like MESSAGE or responses like the 200 OK after a OPTIONS request from the server

However the issue impacts also registered users, not only guest. But after removing the guest check in this PR, everything works fine even when registering to the server before placing the call.

I did not (yet) test helper sessions though, will update you on this

@flaviogrossi
Copy link
Contributor

I quickly tested helper sessions using the demo in the html/ directory and everything seems to work

@lminiero
Copy link
Member Author

@flaviogrossi thanks for the tests! I'll remove the guest check then.

@lminiero lminiero changed the title Manually add SIP Contact header for guest calls when using Sofia >= 1.13 (fixes #2439, replaces #2597) Manually add SIP Contact header for calls when using Sofia >= 1.13 (fixes #2439, replaces #2597) Jun 29, 2021
@lminiero
Copy link
Member Author

lminiero commented Jul 1, 2021

Thanks to Flavio's tests, I think this can be merged now 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants